package com.examplemartin.jpademo.util;

import javax.servlet.http.HttpServletRequest;

/**
 * 项目通用工具类
 */
public class StringUtil {
  /**
   * 判断请求是否是ajax
   * @param request
   * @return
   */
  public static boolean isAjax(HttpServletRequest request){
    String header = request.getHeader("X-Requested-With");
    if("XMLHttpRequest".equals(header))return true;
    return false;
  }

}
